home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / ImageCodec.p < prev    next >
Text File  |  1995-09-14  |  6KB  |  195 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 7:13:23 PM }
  2. {}
  3. {     File:        ImageCodec.p}
  4. { }
  5. {     Contains:    QuickTime Interfaces.}
  6. { }
  7. {     Version:    Technology:    QuickTime 2.0}
  8. {                 Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
  9. { }
  10. {     Copyright:    © 1984-1995 by Apple Computer, Inc.}
  11. {                 All rights reserved.}
  12. { }
  13. {     Bugs?:        If you find a problem with this file, use the Apple Bug Reporter}
  14. {                 stack.  Include the file and version information (from above)}
  15. {                 in the problem description and send to:}
  16. {                     Internet:    apple.bugs@applelink.apple.com}
  17. {                     AppleLink:    APPLE.BUGS}
  18. { }
  19. {}
  20.  
  21. unit ImageCodec;
  22. interface
  23.  
  24.  
  25. {$IFC UNDEFINED __IMAGECODEC__}
  26. {$SETC __IMAGECODEC__ := 1}
  27.  
  28.     uses
  29.         ConditionalMacros, Types, Quickdraw, QDOffscreen, Controls, Windows, Components, Dialogs, StandardFile, ImageCompression, Movies;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35.     const
  36.         codecGetCodecInfo = $00;
  37.         codecGetCompressionTime = $01;
  38.         codecGetMaxCompressionSize = $02;
  39.         codecPreCompress = $03;
  40.         codecBandCompress = $04;
  41.         codecPreDecompress = $05;
  42.         codecBandDecompress = $06;
  43.         codecCDSequenceBusy = $07;
  44.         codecGetCompressedImageSize = $08;
  45.         codecGetSimilarity = $09;
  46.         codecTrimImage = $0A;
  47.         codecRequestSettings = $0B;
  48.         codecGetSettings = $0C;
  49.         codecSetSettings = $0D;
  50.         codecCDSequenceFlush = $0E;
  51.         codecSetTimeCode = $0F;
  52.  
  53.         codecCanScale = $1;
  54.         codecCanMask = $2;
  55.         codecCanMatte = $4;
  56.         codecCanTransform = $8;
  57.         codecCanTransferMode = $10;
  58.         codecCanCopyPrev = $20;
  59.         codecCanSpool = $40;
  60.         codecCanClipVertical = $80;
  61.         codecCanClipRectangular = $100;
  62.         codecCanRemapColor = $200;
  63.         codecCanFastDither = $400;
  64.         codecCanSrcExtract = $800;
  65.         codecCanCopyPrevComp = $1000;
  66.         codecCanAsync = $2000;
  67.         codecCanMakeMask = $4000;
  68.         codecCanShift = $8000;
  69.         codecCanAsyncWhen = $10000;
  70.         codecCanShieldCursor = $20000;
  71.         codecCanManagePrevBuffer = $40000;
  72.  
  73.  
  74.     type
  75.         CodecCapabilities = record
  76.                 flags: LONGINT;
  77.                 wantedPixelSize: INTEGER;
  78.                 extendWidth: INTEGER;
  79.                 extendHeight: INTEGER;
  80.                 bandMin: INTEGER;
  81.                 bandInc: INTEGER;
  82.                 pad: INTEGER;
  83.                 time: LONGINT;
  84.             end;
  85.  
  86.  
  87.     const
  88.         codecConditionFirstBand = $1;
  89.         codecConditionLastBand = $2;
  90.         codecConditionFirstFrame = $4;
  91.         codecConditionNewDepth = $8;
  92.         codecConditionNewTransform = $10;
  93.         codecConditionNewSrcRect = $20;
  94.         codecConditionNewMask = $40;
  95.         codecConditionNewMatte = $80;
  96.         codecConditionNewTransferMode = $100;
  97.         codecConditionNewClut = $200;
  98.         codecConditionNewAccuracy = $400;
  99.         codecConditionNewDestination = $800;
  100.         codecConditionFirstScreen = $1000;
  101.         codecConditionDoCursor = $2000;
  102.         codecConditionCatchUpDiff = $4000;
  103.         codecConditionCodecChangedMask = $80000000;
  104.  
  105.         codecInfoResourceType = 'cdci';
  106.         codecInterfaceVersion = 2;
  107.  
  108.  
  109.     type
  110.         CodecCompressParams = record
  111.                 sequenceID: ImageSequence;
  112.                 imageDescription: ImageDescriptionHandle;
  113.                 data: Ptr;
  114.                 bufferSize: LONGINT;
  115.                 frameNumber: LONGINT;
  116.                 startLine: LONGINT;
  117.                 stopLine: LONGINT;
  118.                 conditionFlags: LONGINT;
  119.                 callerFlags: CodecFlags;
  120.                 capabilities: ^CodecCapabilities;
  121.                 progressProcRecord: ICMProgressProcRecord;
  122.                 completionProcRecord: ICMCompletionProcRecord;
  123.                 flushProcRecord: ICMFlushProcRecord;
  124.                 srcPixMap: PixMap;
  125.                 prevPixMap: PixMap;
  126.                 spatialQuality: CodecQ;
  127.                 temporalQuality: CodecQ;
  128.                 similarity: Fixed;
  129.                 dataRateParams: DataRateParamsPtr;
  130.                 reserved: LONGINT;
  131.             end;
  132.  
  133.         CodecDecompressParams = record
  134.                 sequenceID: ImageSequence;
  135.                 imageDescription: ImageDescriptionHandle;
  136.                 data: Ptr;
  137.                 bufferSize: LONGINT;
  138.                 frameNumber: LONGINT;
  139.                 startLine: LONGINT;
  140.                 stopLine: LONGINT;
  141.                 conditionFlags: LONGINT;
  142.                 callerFlags: CodecFlags;
  143.                 capabilities: ^CodecCapabilities;
  144.                 progressProcRecord: ICMProgressProcRecord;
  145.                 completionProcRecord: ICMCompletionProcRecord;
  146.                 dataProcRecord: ICMDataProcRecord;
  147.                 port: CGrafPtr;
  148.                 dstPixMap: PixMap;
  149.                 maskBits: BitMapPtr;
  150.                 mattePixMap: PixMapPtr;
  151.                 srcRect: Rect;
  152.                 matrix: ^MatrixRecord;
  153.                 accuracy: CodecQ;
  154.                 transferMode: INTEGER;
  155.                 frameTime: ICMFrameTimePtr;
  156.                 reserved: array[0..0] of LONGINT;
  157.                 matrixFlags: SInt8;
  158.                 matrixType: SInt8;
  159.                 dstRect: Rect;
  160.             end;
  161.  
  162.  
  163.     const
  164.         matrixFlagScale2x = $80;
  165.  
  166.  
  167.     function CDGetCodecInfo (storage: Handle; var info: CodecInfo): ComponentResult;
  168.     function CDGetCompressionTime (storage: Handle; src: PixMapHandle; {CONST}
  169.                                     var srcRect: Rect; depth: INTEGER; var spatialQuality: CodecQ; var temporalQuality: CodecQ; var time: LONGINT): ComponentResult;
  170.     function CDGetMaxCompressionSize (storage: Handle; src: PixMapHandle; {CONST}
  171.                                     var srcRect: Rect; depth: INTEGER; quality: CodecQ; var size: LONGINT): ComponentResult;
  172.     function CDPreCompress (storage: Handle; var params: CodecCompressParams): ComponentResult;
  173.     function CDBandCompress (storage: Handle; var params: CodecCompressParams): ComponentResult;
  174.     function CDPreDecompress (storage: Handle; var params: CodecDecompressParams): ComponentResult;
  175.     function CDBandDecompress (storage: Handle; var params: CodecDecompressParams): ComponentResult;
  176.     function CDCodecBusy (storage: Handle; seq: ImageSequence): ComponentResult;
  177.     function CDGetCompressedImageSize (storage: Handle; desc: ImageDescriptionHandle; data: Ptr; bufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; var dataSize: LONGINT): ComponentResult;
  178.     function CDGetSimilarity (storage: Handle; src: PixMapHandle; {CONST}
  179.                                     var srcRect: Rect; desc: ImageDescriptionHandle; data: Ptr; var similarity: Fixed): ComponentResult;
  180.     function CDTrimImage (storage: Handle; Desc: ImageDescriptionHandle; inData: Ptr; inBufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; outData: Ptr; outBufferSize: LONGINT; flushProc: ICMFlushProcRecordPtr; var trimRect: Rect; progressProc: ICMProgressProcRecordPtr): ComponentResult;
  181.     function CDRequestSettings (storage: Handle; settings: Handle; var rp: Rect; filterProc: ModalFilterUPP): ComponentResult;
  182.     function CDGetSettings (storage: Handle; settings: Handle): ComponentResult;
  183.     function CDSetSettings (storage: Handle; settings: Handle): ComponentResult;
  184.     function CDCodecFlush (storage: Handle): ComponentResult;
  185.     function CDCodecSetTimeCode (storage: Handle; timeCodeFormat: univ Ptr; timeCodeTime: univ Ptr): ComponentResult;
  186.  
  187. { $ALIGN RESET}
  188. { $POP}
  189.  
  190. {$ENDC}
  191.  {__IMAGECODEC__}
  192.  
  193. implementation
  194. end.
  195.